import uniqueId from '@form-create/utils/lib/unique';
import { localeProps, makeOptionsRule, makeRequiredRule } from '../../utils/index';

const label = '人员选择';
const name = 'jd-approver';

export default {
    icon: 'icon-approver',
    label,
    name,
    rule({ t }) {
        const opt = t('props.option');
        return {
            type: 'Jd-Approver',
            field: 'RYXZ',
            title: '人员选择',
            info: '',
            effect: {
                fetch: ''
            },
            $required: false,
            validate: false,
            style: { width: '100%' },
            props: {
                options: [1, 2].map((value) => {
                    return {
                        label: opt + value,
                        value,
                        children: []
                    };
                }),
				multiple: true
            }
        };
    },
    props(_, { t }) {
        return localeProps(t, name + '.props', [
            makeRequiredRule(),
            { type: 'input', field: 'placeholder', title: '输入框占位文本' },
            { type: 'switch', field: 'disabled', title: '是否禁用', col: { span: 12 } },
            { type: 'switch', field: 'clearable', title: '清空选项', col: { span: 12 } },
            { type: 'switch', field: 'multiple', title: '是否多选', col: { span: 12 }, value: '' },
            { type: 'switch', field: 'collapseTags', title: '折叠显示', col: { span: 12 } }
        ]);
    }
};
